%%{init: {'themeVariables': { 'fontSize': '12px'}}}%%
graph TD
    classDef path fill:#eee,stroke:#000,color:#000
    classDef plan fill:#fff,stroke-width:1px,color:#000
    classDef itemplan fill:#fff,stroke-width:2px,color:#000
    classDef unbatchedplan fill:#dff,stroke-width:1px,color:#000
    classDef sideeffectplan fill:#fcc,stroke-width:2px,color:#000
    classDef bucket fill:#f6f6f6,color:#000,stroke-width:2px,text-align:left

    subgraph "Buckets for queries/interfaces-relational/relation"
    Bucket0("Bucket 0 (root)<br /><br />1: PgSelectInlineApply[197]<br />ᐳ: 8, 9, 205, 10<br />2: PgSelectInlineApply[201]<br />3: PgSelect[7]<br />ᐳ: Access[202]<br />4: PgSelectRows[12]<br />ᐳ: 11, 13, 14, 16, 17, 203, 204<br />5: PgSelectRows[64]<br />ᐳ: First[63], PgSelectSingle[65]"):::bucket
    Bucket1("Bucket 1 (polymorphic)<br />__typename: Lambda[17]<br />Deps: 17, 10, 14, 65, 204"):::bucket
    Bucket2("Bucket 2 (polymorphicPartition)<br />|RelationalTopic<br />Deps: 10, 14, 65, 204<br />ᐳRelationalTopic<br /><br />1: PgSelect[19]<br />2: PgSelectRows[24]<br />ᐳ: First[23], PgSelectSingle[25]"):::bucket
    Bucket3("Bucket 3 (polymorphicPartition)<br />|RelationalPost<br />Deps: 10, 14, 65, 204<br />ᐳRelationalPost<br /><br />1: PgSelect[27]<br />2: PgSelectRows[32]<br />ᐳ: First[31], PgSelectSingle[33]"):::bucket
    Bucket4("Bucket 4 (polymorphicPartition)<br />|RelationalDivider<br />Deps: 10, 14, 65, 204<br />ᐳRelationalDivider<br /><br />1: PgSelect[35]<br />2: PgSelectRows[40]<br />ᐳ: First[39], PgSelectSingle[41]"):::bucket
    Bucket5("Bucket 5 (polymorphicPartition)<br />|RelationalChecklist<br />Deps: 10, 14, 65, 204<br />ᐳRelationalChecklist<br /><br />1: PgSelect[43]<br />2: PgSelectRows[48]<br />ᐳ: First[47], PgSelectSingle[49]"):::bucket
    Bucket6("Bucket 6 (polymorphicPartition)<br />|RelationalChecklistItem<br />Deps: 10, 14, 65, 204<br />ᐳRelationalChecklistItem<br /><br />1: PgSelect[51]<br />2: PgSelectRows[56]<br />ᐳ: First[55], PgSelectSingle[57]"):::bucket
    Bucket7("Bucket 7 (combined)<br />Deps: 65, 204, 10<br /><br />1: 103, 105, 198<br />ᐳ: Lambda[106], List[199], Lambda[200]<br />2: PgSelectRows[158]<br />ᐳ: First[157], PgSelectSingle[159]"):::bucket
    Bucket8("Bucket 8 (polymorphic)<br />__typename: Lambda[106]<br />Deps: 106, 10, 103, 159"):::bucket
    Bucket9("Bucket 9 (polymorphicPartition)<br />|RelationalTopic<br />Deps: 10, 103, 159<br />(5) ...ᐳRelationalTopic<br /><br />1: PgSelect[108]<br />2: PgSelectRows[113]<br />ᐳ: First[112], PgSelectSingle[114]"):::bucket
    Bucket10("Bucket 10 (polymorphicPartition)<br />|RelationalPost<br />Deps: 10, 103, 159<br />(5) ...ᐳRelationalPost<br /><br />1: PgSelect[116]<br />2: PgSelectRows[121]<br />ᐳ: First[120], PgSelectSingle[122]"):::bucket
    Bucket11("Bucket 11 (polymorphicPartition)<br />|RelationalDivider<br />Deps: 10, 103, 159<br />(5) ...ᐳRelationalDivider<br /><br />1: PgSelect[124]<br />2: PgSelectRows[129]<br />ᐳ: First[128], PgSelectSingle[130]"):::bucket
    Bucket12("Bucket 12 (polymorphicPartition)<br />|RelationalChecklist<br />Deps: 10, 103, 159<br />(5) ...ᐳRelationalChecklist<br /><br />1: PgSelect[132]<br />2: PgSelectRows[137]<br />ᐳ: First[136], PgSelectSingle[138]"):::bucket
    Bucket13("Bucket 13 (polymorphicPartition)<br />|RelationalChecklistItem<br />Deps: 10, 103, 159<br />(5) ...ᐳRelationalChecklistItem<br /><br />1: PgSelect[140]<br />2: PgSelectRows[145]<br />ᐳ: First[144], PgSelectSingle[146]"):::bucket
    Bucket14("Bucket 14 (nullableBoundary)<br />Deps: 159<br /><br />ROOT PgSelectSingle{7}ᐸpeopleᐳ[159]"):::bucket
    Bucket15("Bucket 15 (nullableBoundary)<br />Deps: 159<br /><br />ROOT PgSelectSingle{7}ᐸpeopleᐳ[159]"):::bucket
    Bucket16("Bucket 16 (nullableBoundary)<br />Deps: 159<br /><br />ROOT PgSelectSingle{7}ᐸpeopleᐳ[159]"):::bucket
    Bucket17("Bucket 17 (nullableBoundary)<br />Deps: 159<br /><br />ROOT PgSelectSingle{7}ᐸpeopleᐳ[159]"):::bucket
    Bucket18("Bucket 18 (nullableBoundary)<br />Deps: 159<br /><br />ROOT PgSelectSingle{7}ᐸpeopleᐳ[159]"):::bucket
    end
    Bucket0 --> Bucket1
    Bucket1 --> Bucket2 & Bucket3 & Bucket4 & Bucket5 & Bucket6
    Bucket2 --> Bucket7
    Bucket3 --> Bucket7
    Bucket4 --> Bucket7
    Bucket5 --> Bucket7
    Bucket6 --> Bucket7
    Bucket7 --> Bucket8
    Bucket8 --> Bucket9 & Bucket10 & Bucket11 & Bucket12 & Bucket13
    Bucket9 --> Bucket14
    Bucket10 --> Bucket15
    Bucket11 --> Bucket16
    Bucket12 --> Bucket17
    Bucket13 --> Bucket18

    %% plan dependencies
    PgSelect7[["PgSelect[7∈0] ➊<br />ᐸrelational_itemsᐳ<br />More deps:<br />- Object[10]<br />- Constantᐸ15ᐳ[205]"]]:::plan
    PgSelectInlineApply201["PgSelectInlineApply[201∈0] ➊"]:::plan
    PgSelectInlineApply201 --> PgSelect7
    Object10{{"Object[10∈0] ➊<br />ᐸ{pgSettings,withPgClient}ᐳ<br />Dependents: 11"}}:::plan
    Access8{{"Access[8∈0] ➊<br />ᐸ2.pgSettingsᐳ"}}:::plan
    Access9{{"Access[9∈0] ➊<br />ᐸ2.withPgClientᐳ"}}:::plan
    Access8 & Access9 --> Object10
    List203{{"List[203∈0] ➊<br />ᐸ202,13ᐳ"}}:::plan
    Access202{{"Access[202∈0] ➊<br />ᐸ7.m.joinDetailsFor59ᐳ"}}:::plan
    PgSelectSingle13{{"PgSelectSingle[13∈0] ➊<br />ᐸrelational_itemsᐳ"}}:::plan
    Access202 & PgSelectSingle13 --> List203
    __Value2["__Value[2∈0] ➊<br />ᐸcontextᐳ"]:::plan
    __Value2 --> Access8
    __Value2 --> Access9
    First11{{"First[11∈0] ➊"}}:::plan
    PgSelectRows12[["PgSelectRows[12∈0] ➊"]]:::plan
    PgSelectRows12 --> First11
    PgSelect7 --> PgSelectRows12
    First11 --> PgSelectSingle13
    PgClassExpression14{{"PgClassExpression[14∈0] ➊<br />ᐸ__relation...ems__.”id”ᐳ"}}:::plan
    PgSelectSingle13 --> PgClassExpression14
    PgClassExpression16{{"PgClassExpression[16∈0] ➊<br />ᐸ__relation...s__.”type”ᐳ"}}:::plan
    PgSelectSingle13 --> PgClassExpression16
    First63{{"First[63∈0] ➊"}}:::plan
    PgSelectRows64[["PgSelectRows[64∈0] ➊<br />More deps:<br />- Lambda[204]"]]:::plan
    PgSelectRows64 --> First63
    PgSelectSingle65{{"PgSelectSingle[65∈0] ➊<br />ᐸrelational_itemsᐳ"}}:::plan
    First63 --> PgSelectSingle65
    PgSelectInlineApply197["PgSelectInlineApply[197∈0] ➊"]:::plan
    PgSelectInlineApply197 --> PgSelectInlineApply201
    PgSelect7 --> Access202
    Lambda204{{"Lambda[204∈0] ➊<br />ᐸpgInlineViaJoinTransformᐳ<br />Dependents: 2"}}:::plan
    List203 --> Lambda204
    PgSelect19[["PgSelect[19∈2] ➊<br />ᐸrelational_topicsᐳ<br />ᐳRelationalTopic<br />More deps:<br />- Object[10]"]]:::plan
    PgClassExpression14 --> PgSelect19
    First23{{"First[23∈2] ➊^"}}:::plan
    PgSelectRows24[["PgSelectRows[24∈2] ➊^"]]:::plan
    PgSelectRows24 --> First23
    PgSelect19 --> PgSelectRows24
    PgSelectSingle25{{"PgSelectSingle[25∈2] ➊^<br />ᐸrelational_topicsᐳ"}}:::plan
    First23 --> PgSelectSingle25
    PgSelect27[["PgSelect[27∈3] ➊<br />ᐸrelational_postsᐳ<br />ᐳRelationalPost<br />More deps:<br />- Object[10]"]]:::plan
    PgClassExpression14 --> PgSelect27
    First31{{"First[31∈3] ➊^"}}:::plan
    PgSelectRows32[["PgSelectRows[32∈3] ➊^"]]:::plan
    PgSelectRows32 --> First31
    PgSelect27 --> PgSelectRows32
    PgSelectSingle33{{"PgSelectSingle[33∈3] ➊^<br />ᐸrelational_postsᐳ"}}:::plan
    First31 --> PgSelectSingle33
    PgSelect35[["PgSelect[35∈4] ➊<br />ᐸrelational_dividersᐳ<br />ᐳRelationalDivider<br />More deps:<br />- Object[10]"]]:::plan
    PgClassExpression14 --> PgSelect35
    First39{{"First[39∈4] ➊^"}}:::plan
    PgSelectRows40[["PgSelectRows[40∈4] ➊^"]]:::plan
    PgSelectRows40 --> First39
    PgSelect35 --> PgSelectRows40
    PgSelectSingle41{{"PgSelectSingle[41∈4] ➊^<br />ᐸrelational_dividersᐳ"}}:::plan
    First39 --> PgSelectSingle41
    PgSelect43[["PgSelect[43∈5] ➊<br />ᐸrelational_checklistsᐳ<br />ᐳRelationalChecklist<br />More deps:<br />- Object[10]"]]:::plan
    PgClassExpression14 --> PgSelect43
    First47{{"First[47∈5] ➊^"}}:::plan
    PgSelectRows48[["PgSelectRows[48∈5] ➊^"]]:::plan
    PgSelectRows48 --> First47
    PgSelect43 --> PgSelectRows48
    PgSelectSingle49{{"PgSelectSingle[49∈5] ➊^<br />ᐸrelational_checklistsᐳ"}}:::plan
    First47 --> PgSelectSingle49
    PgSelect51[["PgSelect[51∈6] ➊<br />ᐸrelational_checklist_itemsᐳ<br />ᐳRelationalChecklistItem<br />More deps:<br />- Object[10]"]]:::plan
    PgClassExpression14 --> PgSelect51
    First55{{"First[55∈6] ➊^"}}:::plan
    PgSelectRows56[["PgSelectRows[56∈6] ➊^"]]:::plan
    PgSelectRows56 --> First55
    PgSelect51 --> PgSelectRows56
    PgSelectSingle57{{"PgSelectSingle[57∈6] ➊^<br />ᐸrelational_checklist_itemsᐳ"}}:::plan
    First55 --> PgSelectSingle57
    List199{{"List[199∈7] ➊^<br />ᐸ198,65ᐳ"}}:::plan
    Access198{{"Access[198∈7] ➊<br />ᐸ204.m.joinDetailsFor153ᐳ<br />ᐳRelationalTopic<br />ᐳRelationalPost<br />ᐳRelationalDivider<br />ᐳRelationalChecklist<br />ᐳRelationalChecklistItem<br />More deps:<br />- Lambda[204]"}}:::plan
    Access198 & PgSelectSingle65 --> List199
    PgClassExpression103{{"PgClassExpression[103∈7] ➊<br />ᐸ__relation...ems__.”id”ᐳ<br />ᐳRelationalTopic<br />ᐳRelationalPost<br />ᐳRelationalDivider<br />ᐳRelationalChecklist<br />ᐳRelationalChecklistItem"}}:::plan
    PgSelectSingle65 --> PgClassExpression103
    PgClassExpression105{{"PgClassExpression[105∈7] ➊<br />ᐸ__relation...s__.”type”ᐳ<br />ᐳRelationalTopic<br />ᐳRelationalPost<br />ᐳRelationalDivider<br />ᐳRelationalChecklist<br />ᐳRelationalChecklistItem"}}:::plan
    PgSelectSingle65 --> PgClassExpression105
    Lambda106{{"Lambda[106∈7] ➊^<br />ᐸrelationalItemTypeNameFromTypeᐳ"}}:::plan
    PgClassExpression105 --> Lambda106
    First157{{"First[157∈7] ➊^"}}:::plan
    PgSelectRows158[["PgSelectRows[158∈7] ➊^"]]:::plan
    PgSelectRows158 --> First157
    Lambda200{{"Lambda[200∈7] ➊^<br />ᐸpgInlineViaJoinTransformᐳ"}}:::plan
    Lambda200 --> PgSelectRows158
    PgSelectSingle159{{"PgSelectSingle[159∈7] ➊^<br />ᐸpeopleᐳ"}}:::plan
    First157 --> PgSelectSingle159
    List199 --> Lambda200
    PgSelect108[["PgSelect[108∈9] ➊<br />ᐸrelational_topicsᐳ<br />(5) ...ᐳRelationalTopic<br />More deps:<br />- Object[10]"]]:::plan
    PgClassExpression103 --> PgSelect108
    First112{{"First[112∈9] ➊^"}}:::plan
    PgSelectRows113[["PgSelectRows[113∈9] ➊^"]]:::plan
    PgSelectRows113 --> First112
    PgSelect108 --> PgSelectRows113
    PgSelectSingle114{{"PgSelectSingle[114∈9] ➊^<br />ᐸrelational_topicsᐳ"}}:::plan
    First112 --> PgSelectSingle114
    PgSelect116[["PgSelect[116∈10] ➊<br />ᐸrelational_postsᐳ<br />(5) ...ᐳRelationalPost<br />More deps:<br />- Object[10]"]]:::plan
    PgClassExpression103 --> PgSelect116
    First120{{"First[120∈10] ➊^"}}:::plan
    PgSelectRows121[["PgSelectRows[121∈10] ➊^"]]:::plan
    PgSelectRows121 --> First120
    PgSelect116 --> PgSelectRows121
    PgSelectSingle122{{"PgSelectSingle[122∈10] ➊^<br />ᐸrelational_postsᐳ"}}:::plan
    First120 --> PgSelectSingle122
    PgSelect124[["PgSelect[124∈11] ➊<br />ᐸrelational_dividersᐳ<br />(5) ...ᐳRelationalDivider<br />More deps:<br />- Object[10]"]]:::plan
    PgClassExpression103 --> PgSelect124
    First128{{"First[128∈11] ➊^"}}:::plan
    PgSelectRows129[["PgSelectRows[129∈11] ➊^"]]:::plan
    PgSelectRows129 --> First128
    PgSelect124 --> PgSelectRows129
    PgSelectSingle130{{"PgSelectSingle[130∈11] ➊^<br />ᐸrelational_dividersᐳ"}}:::plan
    First128 --> PgSelectSingle130
    PgSelect132[["PgSelect[132∈12] ➊<br />ᐸrelational_checklistsᐳ<br />(5) ...ᐳRelationalChecklist<br />More deps:<br />- Object[10]"]]:::plan
    PgClassExpression103 --> PgSelect132
    First136{{"First[136∈12] ➊^"}}:::plan
    PgSelectRows137[["PgSelectRows[137∈12] ➊^"]]:::plan
    PgSelectRows137 --> First136
    PgSelect132 --> PgSelectRows137
    PgSelectSingle138{{"PgSelectSingle[138∈12] ➊^<br />ᐸrelational_checklistsᐳ"}}:::plan
    First136 --> PgSelectSingle138
    PgSelect140[["PgSelect[140∈13] ➊<br />ᐸrelational_checklist_itemsᐳ<br />(5) ...ᐳRelationalChecklistItem<br />More deps:<br />- Object[10]"]]:::plan
    PgClassExpression103 --> PgSelect140
    First144{{"First[144∈13] ➊^"}}:::plan
    PgSelectRows145[["PgSelectRows[145∈13] ➊^"]]:::plan
    PgSelectRows145 --> First144
    PgSelect140 --> PgSelectRows145
    PgSelectSingle146{{"PgSelectSingle[146∈13] ➊^<br />ᐸrelational_checklist_itemsᐳ"}}:::plan
    First144 --> PgSelectSingle146
    PgClassExpression192{{"PgClassExpression[192∈14] ➊<br />ᐸ__people__.”username”ᐳ<br />(5) ...ᐳRelationalTopic"}}:::plan
    PgSelectSingle159 --> PgClassExpression192
    PgClassExpression193{{"PgClassExpression[193∈15] ➊<br />ᐸ__people__.”username”ᐳ<br />(5) ...ᐳRelationalPost"}}:::plan
    PgClassExpression192 o--o PgClassExpression193
    PgClassExpression194{{"PgClassExpression[194∈16] ➊<br />ᐸ__people__.”username”ᐳ<br />(5) ...ᐳRelationalDivider"}}:::plan
    PgClassExpression193 o--o PgClassExpression194
    PgClassExpression195{{"PgClassExpression[195∈17] ➊<br />ᐸ__people__.”username”ᐳ<br />(5) ...ᐳRelationalChecklist"}}:::plan
    PgClassExpression194 o--o PgClassExpression195
    PgClassExpression196{{"PgClassExpression[196∈18] ➊<br />ᐸ__people__.”username”ᐳ<br />(5) ...ᐳRelationalChecklistItem"}}:::plan
    PgClassExpression195 o--o PgClassExpression196

    %% define steps
    classDef bucket0 stroke:#696969
    class Bucket0,__Value2,PgSelect7,Access8,Access9,Object10,First11,PgSelectRows12,PgSelectSingle13,PgClassExpression14,PgClassExpression16,First63,PgSelectRows64,PgSelectSingle65,PgSelectInlineApply197,PgSelectInlineApply201,Access202,List203,Lambda204 bucket0
    classDef bucket1 stroke:#00bfff
    class Bucket1 bucket1
    classDef bucket2 stroke:#7f007f
    class Bucket2,PgSelect19,First23,PgSelectRows24,PgSelectSingle25 bucket2
    classDef bucket3 stroke:#ffa500
    class Bucket3,PgSelect27,First31,PgSelectRows32,PgSelectSingle33 bucket3
    classDef bucket4 stroke:#0000ff
    class Bucket4,PgSelect35,First39,PgSelectRows40,PgSelectSingle41 bucket4
    classDef bucket5 stroke:#7fff00
    class Bucket5,PgSelect43,First47,PgSelectRows48,PgSelectSingle49 bucket5
    classDef bucket6 stroke:#ff1493
    class Bucket6,PgSelect51,First55,PgSelectRows56,PgSelectSingle57 bucket6
    classDef bucket7 stroke:#808000
    class Bucket7,PgClassExpression103,PgClassExpression105,Lambda106,First157,PgSelectRows158,PgSelectSingle159,Access198,List199,Lambda200 bucket7
    classDef bucket8 stroke:#dda0dd
    class Bucket8 bucket8
    classDef bucket9 stroke:#ff0000
    class Bucket9,PgSelect108,First112,PgSelectRows113,PgSelectSingle114 bucket9
    classDef bucket10 stroke:#ffff00
    class Bucket10,PgSelect116,First120,PgSelectRows121,PgSelectSingle122 bucket10
    classDef bucket11 stroke:#00ffff
    class Bucket11,PgSelect124,First128,PgSelectRows129,PgSelectSingle130 bucket11
    classDef bucket12 stroke:#4169e1
    class Bucket12,PgSelect132,First136,PgSelectRows137,PgSelectSingle138 bucket12
    classDef bucket13 stroke:#3cb371
    class Bucket13,PgSelect140,First144,PgSelectRows145,PgSelectSingle146 bucket13
    classDef bucket14 stroke:#a52a2a
    class Bucket14,PgClassExpression192 bucket14
    classDef bucket15 stroke:#ff00ff
    class Bucket15,PgClassExpression193 bucket15
    classDef bucket16 stroke:#f5deb3
    class Bucket16,PgClassExpression194 bucket16
    classDef bucket17 stroke:#696969
    class Bucket17,PgClassExpression195 bucket17
    classDef bucket18 stroke:#00bfff
    class Bucket18,PgClassExpression196 bucket18

